using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using pos.entity;
using idea.tools;

namespace pos
{
    public partial class ParaClass1Frm : Form
    {
        public ParaClass1Frm()
        {
            InitializeComponent();
        }

        private void ParaClass1Frm_Load(object sender, EventArgs e)
        {
           
            listView1.Height = this.Height - 100;
            t_class1 t = new t_class1();
            ListViewTool lt = new ListViewTool(listView1);
            t.HeadInsert = lt.insertHead;
            t.RowInsert = lt.insertRow;
            t.ExecDataInsertByQuery(null);
        }

        private void cmdAdd_Click(object sender, EventArgs e)
        {
            try
            {
                string str = textBox1.Text.Trim(); ;
                if (str == "")
                    return;
                t_class1 t = new t_class1();
                sequence s = new sequence(t_class1.SEQN0);
                t.seqID = s.getNumberSequence();
                t.name = str;
                t.add();
                s.UpdateSequence();
                ListViewTool lt = new ListViewTool(listView1);
                t.RowInsert = lt.insertRow;
                t.ExecDataInsert();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }

        private void listView1_SelectedIndexChanged(object sender, EventArgs e)
        {

        }

        private void class1_Click(object sender, EventArgs e)
        {

        }

        private void textBox1_TextChanged(object sender, EventArgs e)
        {

        }
    }
}